function noticeAdd(){
    var theme = $("#theme").val();
    var content = $("#content").val();
    var protocol = window.location.protocol;
    var host = window.location.host;
    if (theme == ""){
        layer.open({
            title: '提示信息',
            anim: 0,
            resize:false,//是否可以拉伸  默认true
            icon: 2,
            shadeClose: true,
            skin: 'layui-layer-molv',
            content: "主题不能为空！",
            yes:function (index){
                $('#theme').focus();
                layer.close(index);
            }
        });
        return "";
    }
    if (content == ""){
        layer.open({
            title: '提示信息',
            anim: 0,
            resize:false,//是否可以拉伸  默认true
            icon: 2,
            shadeClose: true,
            skin: 'layui-layer-molv',
            content: "内容不能为空！",
            yes:function (index){
                $('#content').focus();
                layer.close(index);
            }
        });
        return "";
    }

    $.ajax({
        type : 'POST',
        url : '/noticeAdd',
        data : {theme:theme,content:content},
        success:function (data) {
            if (data == "OK"){
                layer.msg('添加成功', {
                    icon: 1,
                    shadeClose: true,
                    skin: 'layui-layer-molv',
                    time: 2000 //2秒关闭（如果不配置，默认是3秒）
                }, function(){
                    window.location.href = protocol+"//"+host+"/notice";
                });
            }else {
                layer.open({
                    title: '提示信息',
                    anim: 0,
                    resize:false,//是否可以拉伸  默认true
                    icon: 2,
                    shadeClose: true,
                    skin: 'layui-layer-molv',
                    content: data
                });
            }
        },
        error: function (e) {
            console.log(e)
        }
    });
}

